Skip to content

Conversation

@JosePizarro3
Copy link
Member

@JosePizarro3 JosePizarro3 commented Oct 30, 2025

This pull request adds support for specifying the type of collection to create in openBIS, either "COLLECTION" or "DEFAULT_EXPERIMENT", through the CLI and programmatic interfaces. It updates the documentation and tests to reflect this new capability and ensures that invalid collection types are handled gracefully.

Feature: Collection type selection

  • Added a --collection-type CLI option and a corresponding collection_type parameter to the parser and run_parser functions, allowing users to choose between "COLLECTION" and "DEFAULT_EXPERIMENT" when creating collections in openBIS. [1] [2]
  • Updated the logic in run_parser to validate collection_type and use it when creating new collections, including error handling for invalid types. [1] [2]

Documentation updates

  • Extended the documentation in docs/tutorials/parsing.md to describe the collection_type parameter, its options, usage examples, and recommendations for future compatibility. [1] [2]

Testing improvements

  • Added new tests to verify that run_parser supports both collection types, defaults to "COLLECTION" when not specified, and correctly creates objects in openBIS for each scenario.
  • Updated existing tests to include the collection_type parameter for completeness. [1] [2]

#222)

* Initial plan

* Add collection_type parameter to parser infrastructure

- Add collection_type parameter to run_parser() with default value "COLLECTION"
- Add --collection-type CLI option with choices between COLLECTION and DEFAULT_EXPERIMENT
- Update tests to cover both collection types and default behavior
- Update documentation to explain the new parameter

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: JosePizarro3 <[email protected]>
@JosePizarro3 JosePizarro3 self-assigned this Oct 30, 2025
@JosePizarro3 JosePizarro3 added the enhancement Enhancements on the code base label Oct 30, 2025
@JosePizarro3 JosePizarro3 added the UX Improvement on the user experience label Oct 30, 2025
@JosePizarro3 JosePizarro3 requested a review from Copilot October 30, 2025 08:36
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for configurable collection types in the run_parser function, allowing users to choose between "COLLECTION" and "DEFAULT_EXPERIMENT" when creating collections in openBIS. Previously, the function was hardcoded to use "DEFAULT_EXPERIMENT".

Key Changes:

  • Added a new collection_type parameter to the run_parser function with a default value of "COLLECTION"
  • Added validation to ensure only valid collection types are accepted
  • Updated the CLI to include a --collection-type option with case-insensitive choices
  • Updated existing tests to explicitly specify collection types and added new tests for the feature

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
bam_masterdata/cli/run_parser.py Added collection_type parameter with default "COLLECTION", added validation logic, and replaced hardcoded "DEFAULT_EXPERIMENT" with the parameter
bam_masterdata/cli/cli.py Added --collection-type CLI option with case-insensitive choice validation and uppercase conversion
tests/cli/test_run_parser.py Updated existing tests to specify collection type explicitly, added tests for DEFAULT_EXPERIMENT type and default behavior
docs/tutorials/parsing.md Added documentation for the new collection_type parameter with examples and best practices

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@JosePizarro3 JosePizarro3 merged commit 79f8723 into main Oct 30, 2025
13 checks passed
@JosePizarro3 JosePizarro3 deleted the 221-add-capability-to-support-collection-and-default-experiment-during-parsing branch October 30, 2025 08:39
@coveralls
Copy link

Pull Request Test Coverage Report for Build 18934679482

Details

  • 3 of 5 (60.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.02%) to 60.0%

Changes Missing Coverage Covered Lines Changed/Added Lines %
bam_masterdata/cli/run_parser.py 1 3 33.33%
Totals Coverage Status
Change from base Build 18719348140: -0.02%
Covered Lines: 1125
Relevant Lines: 1875

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Enhancements on the code base UX Improvement on the user experience

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add capability to support Collection and Default experiment during parsing

3 participants